

import { http } from './index'

//获取分类列表

export function CateList(params) {
    return http({url: 'flash/supermarket/classify/page/list', data: params})
}

//获取分类树

export function CateTree(params) {
    return http({url: 'flash/supermarket/classify/tree', data: params})
}

//获取商品根据个人喜好的推荐
export function RecommedGoods(params) {
    return http(`flash/supermarket/goods/user/survey/goods/recommend?openId=${params.openId}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&t=${Date.now()}`)
}

//产品分页查询
export function GoodsList(params) {
    return http({url: 'flash/supermarket/goods/page/list', data: params})
}

//产品详情
export function GoodsInfo(id) {
    return http({url: 'flash/supermarket/goods/get', data: id})
}

//产品的规格列表
export function PpecificationsList(data) {
    return http({url: 'flash/supermarket/goods/specifications/page/list', data: data})
}


//加入和更新购物车
export function GoodsCarEdit(data) {
    return http({url: 'flash/supermarket/cart/saveorupdate?loading', data: data})
}

//获取购物车列表
export function GoodsCarList(data) {
    return http({url: 'flash/supermarket/cart/page/list', data: data})
}

//批量删除成人-购物车
export function GoodsCarDel(ids) {
    return http({url: 'flash/supermarket/cart/batch/del', data: ids})
}

//添加购物车后-下单
export function GoodsCarJoinAndOrder(data) {
    return http({url: 'flash/supermarket/cart/addCartDirectToOrder?loading', data: data})
}

//加减数量-购物车
export function GoodsCarCountNums(data) {
    return http({url: 'flash/supermarket/cart/add/and/subtract/num?loading', data: data})
}

//购物车-总金额-根据用户ID
export function GoodsCarUserMoney(data) {
    return http({url: 'flash/supermarket/cart/getTotalMoney?loading', data: data})
}

//购物车-根据所选的商品-计算价格
export function GoodsCarIdsMoney(ids) {
    return http({url: 'flash/supermarket/cart/getTotalMoneyByCartIds?loading', data:ids})
}

// 热门搜索 
export function HotSearchKey(data) {
    return http({url: 'adult/hot/search/page/list?loading', data:data})
}
// 热门搜索 
export function GoodsListFront(data) {
    return http({url: 'flash/supermarket/goods/front/page/list', data:data})
}

